package com.useeinfo.oa.modules.maintaining.biz;

import com.useeinfo.framework.extend.biz.CrudBiz;
import com.useeinfo.framework.sugar.data.QueryParam;
import com.useeinfo.oa.modules.maintaining.dao.PlanExecuteTimeDao;
import com.useeinfo.oa.modules.maintaining.entity.PlanExecuteTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 */
@Service("planExecuteTimeBiz")
public class PlanExecuteTimeBiz extends CrudBiz<PlanExecuteTimeDao, PlanExecuteTime> {
    @Autowired
    private PlanExecuteTimeDao planExecuteTimeDao;
    public Integer setOperateStatus(int status,Long id){
        return planExecuteTimeDao.setOperateStatus(status,id);
    }
    public void deleteTime(Long id){
        dao.deleteTime(id);
    }

    public List<PlanExecuteTime> createOrder(String remindTime) {
        QueryParam queryParam = new QueryParam();
        queryParam.getSqlMap().put("remindTime", remindTime);
        queryParam.getSqlMap().put("status", "0");
        queryParam.getSqlMap().put("operateStatus", "1");
        List<PlanExecuteTime> planExecuteTimeList = dao.findList(queryParam);
        if (!CollectionUtils.isEmpty(planExecuteTimeList)) {
            return planExecuteTimeList;
        }
        return null;
    }


}
